DICOM
DICOM/DICOM-RT DICOM network node a. IP address, like 156.145.34.157. Some dicom server require reverse DNS entry available to allow connection. b. Port Number, default is 104, sometimes 4004, 4006, 8104, 8888, etc are used, because port number 1-1024 require administrator/root privileges to be bound. If DICOM server can only run in user space, 104 port can not be used due to privileges, on the other hand 104 is the well know port number to public. To solve this dilemma, port forwarding/mapping can be used to reroute traffic arrived at port 104 to the underlying service on port 4004. c. AE title, like SIMPLE_STORAGE, it is used to differentiate various Application Entities within same SCP. AE tile is case sensitive, and if the length is not even, white space could be padded at the end, which cannot be visualized but required to establish connection. DICOM firewall, there are three ways to limit the traffic to DICOM server, a. Firewall on operating system level, like Linux IPtable or Windows Firewall, it can limit the access by source IP address or IP range b. DICOM filtering on application level, some DICOM server has approved dicom node list, only the node in the list can communicate with the DICOM server. c. Router/Switch/firewall can disable the DICOM traffic in between, if SSH service available in SCP, typically SSH tunneling can be used to redirect the network traffic from SCU to SCP; or use VPN to connect user out of firewall to inside. 1) Examples a. Diagnosis of dicom connection First test the TCP/IP connectivity with Ping, Telnet etc, then use dicom echo to test DICOM connectivity , as last use storagescu to send some images to the dicom server to make sure that the images received are same as the ones sent. ..\ctn_w32_3.0.1\bin\dicom_echo.exe -a DICOM_ECHO -c SIMPLE_STORAGE -p -v 156.145.34.197 104 ..\dcmtk-3.6.0-win32-i386\bin\echoscu -v -d -aet ECHOSCU -aec ANY-SCP 156. 145.34.197 104 b. Sending outside dicom to TPS via storescu under CMD.exe, run the following command in directory containing dicom files for %f in (ct*.dcm) do (..\ctn_w32_3.0.1\bin\send_image.exe -a SEND_IMAGE -c SIMPLE_STORAGE 156.145.34.197 104 %f) ..\dcmtk-3.6.0-win32-i386\bin\storescu.exe -aet STORESCU -aec STORESCP 156.145.34.197 104 *.dcm c. Receiving dicom files from a server using storescp under CMD.exe, run the following command in top directory containing dicom files ..\ctn_w32_3.0.1\bin\simple_storage.exe -c SIMPLE_STORAGE -x . 104 ..\dcmtk-3.6.0-win32-i386\bin\storescp.exe -v -aet STORESCP -od . –sp 104 d. Fixing patient orientation For Picker CT scanner, the patient orientation will be reverted after imported to TPS, the slice location should be negated to correct the problem. @echo off setlocal enabledelayedexpansion FOR /f "tokens=*" %%f IN ('dir /b ct*.dcm') do (echo %%f type nul > slice.txt ..\ctn_w32_3.0.1\bin\dcm_dump_element.exe -t 0x0020 0x1041 %%f slice.txt > nul for /f "delims=" %%s in ('type SLICE.txt') do ( set location=%%s set first=!location:~0,1! set rest=!location:~1! echo from echo %%s type nul > slice.txt if !first! EQU - (echo|set /p =!rest! > slice.txt ) else (echo|set /p =-!location! > slice.txt) echo to type slice.txt echo. echo. .. \ctn_w32_3.0.1\bin\dcm_replace_element.exe -t 0x0010 0x0010 name.txt %%f mod_%%f .. \ctn_w32_3.0.1\bin\dcm_replace_element.exe -t 0x0010 0x0010 name.txt %%f mod_%%f ) ) e. Fixing name/mr number under CMD.exe, run the following command in directory containing dicom files echo|set /p =New^Name > name.txt for %f in (ct*.dcm) do (.. \ctn_w32_3.0.1\bin\dcm_replace_element.exe -t 0x0010 0x0010 name.txt %f name_%f) echo|set /p =New_MRN > name.txt for %f in (name_ct*.dcm) do (.. \ctn_w32_3.0.1\bin\dcm_replace_element.exe -t 0x0010 0x0020 mrn.txt %f mrn_%f) ..\dcmtk-3.6.0-win32-i386\bin\dcmodify.exe -m "0x0010,0x0010=New^Name" *.dcm ..\dcmtk-3.6.0-win32-i386\bin\dcmodify.exe -m "0x0010,0x0020=New^MRN" *.dcm f. Annonimization under CMD.exe, run the following command in directory containing dicom files echo|set /p =Anonymous^^^ Anonymous > name.txt for %f in (ct*.dcm) do (.. \ctn_w32_3.0.1\bin\dcm_replace_element.exe -t 0x0010 0x0010 name.txt %f name_%f) echo|set /p =0000 > name.txt for %f in (name_ct*.dcm) do (.. \ctn_w32_3.0.1\bin\dcm_replace_element.exe -t 0x0010 0x0020 mrn.txt %f mrn_%f) ..\dcmtk-3.6.0-win32-i386\bin\dcmodify.exe -m "0x0010,0x0010=Anonymous" *.dcm ..\dcmtk-3.6.0-win32-i386\bin\dcmodify.exe -m "0x0010,0x0020=0000" *.dcm